package com.k7.mobile.platform.bo.impl;

import java.util.List;

import com.k7.mobile.platform.bo.IKeywordBO;
import com.k7.mobile.platform.dao.IKeywordDAO;
import com.k7.mobile.platform.dataobject.KeywordDO;
import com.k7.mobile.platform.exception.BOException;

public class KeywordBOImpl extends BaseBOImpl implements IKeywordBO{
	
	private IKeywordDAO keywordDAO;

	public void setKeywordDAO(IKeywordDAO keywordDAO) {
		this.keywordDAO = keywordDAO;
	}

	public Long add(KeywordDO keywordDO) throws BOException {
		try{ 
			Long id=keywordDAO.add(keywordDO);
			return id;
		}catch(Exception ex){
			log.error("KeywordBOImpl:add,插入Keyword失败", ex);
			throw new BOException("创建禁止Keyword失败", ex);
		}
	}

	@Override
	public void delete(KeywordDO keywordDO) throws BOException {
		try{
			keywordDAO.delete(keywordDO);
		}catch(Exception ex){
			log.error("KeywordBOImpl:delete,删除Keyword失败", ex);
			throw new BOException("删除Keyword失败", ex);
		}
		
	}
	@Override
	public void update(KeywordDO keywordDO) throws BOException {
		try{
			keywordDAO.update(keywordDO);
		}catch(Exception ex){
			log.error("KeywordBOImpl:delete,更新Keyword失败", ex);
			throw new BOException("更新Keyword失败", ex);
		}
		
	}

	@Override
	public List<KeywordDO> findList(KeywordDO keywordDO) throws BOException {
		try{
			List<KeywordDO> list = keywordDAO.findList(keywordDO);
			return list;
		}catch(Exception ex){
			log.error("KeywordBOImpl:findBarDO,批量获取Keyword信息出错", ex);
			throw new BOException("批量获取Keyword信息出错", ex);
		}
		
	}

	@Override
	public KeywordDO getKeyword(KeywordDO keywordDO) throws BOException {
		try{

			KeywordDO returnDO = keywordDAO.getKeyword(keywordDO);

			return returnDO;
		}catch(Exception ex){
			log.error("KeywordBOImpl:getKeyword,获取Keyword信息出错", ex);
			throw new BOException("获取Keyword信息出错", ex);
		}
	}
}
